def totalClinks = 0
def partyPeople = 100

//Also note that the upto method encapsulates and hides the logic of how to
//walk over a sequence of integers.

1.upto(partyPeople) { guestNumber ->
clinksWithGuest = guestNumber-1
totalClinks += clinksWithGuest
}
assert totalClinks == (partyPeople*(partyPeople-1))/2

print totalClinks